<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of bbApply</title>
  <meta name="keywords" content="bbApply">
  <meta name="description" content="Functions for manipulating bounding boxes (bb).">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html detector -->
<h1>bbApply
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Functions for manipulating bounding boxes (bb).</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout = bbApply( action, varargin ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Functions for manipulating bounding boxes (bb).

 A bounding box (bb) is also known as a position vector or a rectangle
 object. It is a four element vector with the fields: [x y w h]. A set of
 n bbs can be stores as an [nx4] array, most funcitons below can handle
 either a single or multiple bbs. In addtion, typically [nxm] inputs with
 m&gt;4 are ok (with the additional columns ignored/copied to the output).

 bbApply contains a number of utility functions for working with bbs. The
 format for accessing the various utility functions is:
  outputs = bbApply( 'action', inputs );
 The list of functions and help for each is given below. Also, help on
 individual subfunctions can be accessed by: &quot;help bbApply&gt;action&quot;.

 Compute area of bbs.
   bb = bbApply( 'area', bb )
 Shift center of bbs.
   bb = bbApply( 'shift', bb, xdel, ydel )
 Get center of bbs.
   cen = bbApply( 'getCenter', bb )
 Get bb at intersection of bb1 and bb2 (may be empty).
   bb = bbApply( 'intersect', bb1, bb2 )
 Get bb that is union of bb1 and bb2 (smallest bb containing both).
   bb = bbApply( 'union', bb1, bb2 )
 Resize the bbs (without moving their centers).
   bb = bbApply( 'resize', bb, hr, wr, [ar] )
 Fix bb aspect ratios (without moving the bb centers).
   bbr = bbApply( 'squarify', bb, flag, [ar] )
 Draw single or multiple bbs to image (calls rectangle()).
   hs = bbApply( 'draw', bb, [col], [lw], [ls], [prop], [ids] )
 Embed single or multiple bbs directly into image.
  I = bbApply( 'embed', I, bb, [varargin] )
 Crop image regions from I encompassed by bbs.
   [patches, bbs] = bbApply('crop',I,bb,[padEl],[dims])
 Convert bb relative to absolute coordinates and vice-versa.
   bb = bbApply( 'convert', bb, bbRef, isAbs )
 Randomly generate bbs that fall in a specified region.
   bbs =  bbApply( 'random', pRandom )
 Convert weighted mask to bbs.
   bbs = bbApply('frMask',M,bbw,bbh,[thr])
 Create weighted mask encoding bb centers (or extent).
   M = bbApply('toMask',bbs,w,h,[fill],[bgrd])

 USAGE
  varargout = bbApply( action, varargin );

 INPUTS
  action     - string specifying action
  varargin   - depends on action, see above

 OUTPUTS
  varargout  - depends on action, see above

 EXAMPLE

 See also bbApply&gt;area bbApply&gt;shift bbApply&gt;getCenter bbApply&gt;intersect
 bbApply&gt;union bbApply&gt;resize bbApply&gt;squarify bbApply&gt;draw bbApply&gt;crop
 bbApply&gt;convert bbApply&gt;random bbApply&gt;frMask bbApply&gt;toMask

 Piotr's Computer Vision Matlab Toolbox      Version 3.30
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
